<?php

namespace App\Http\Resources;


use App\Http\Responses\Resource;
use App\Http\Resources\User as UserCollection;


class BookCollection extends Resource
{
    /**
     * Transform the resource collection into an array.
     *
     * @param  \Illuminate\Http\Request
     * @return array
     */
    public function toArray($request)
    {

        return [
            'id' => $this->id,
            'title' => $this->title,
            'bio' => $this->bio,
            'cover_url' => $this->cover_url,
            'gender' => $this->gender,
            'user' => new UserCollection($this->user)

        ];

    }
}
